package com.esri.core.tasks.na;

import com.esri.core.geometry.Geometry;
import com.esri.core.map.Graphic;
import com.esri.core.symbol.Symbol;
import com.github.mikephil.charting.utils.Utils;
import java.util.Date;
import java.util.Map;

/* loaded from: classes.dex */
public class StopGraphic extends Graphic {
    private static final long serialVersionUID = 1;

    public StopGraphic(Geometry geometry) {
        super(geometry, null);
    }

    public StopGraphic(Geometry geometry, Map<String, Object> map) {
        super(geometry, (Symbol) null, map);
    }

    public StopGraphic(Graphic graphic) {
        this(graphic == null ? null : graphic.getGeometry(), graphic != null ? graphic.getAttributes() : null);
    }

    public String getName() {
        return (String) this.attributes.get("Name");
    }

    public void setName(String str) {
        if (str != null && str.length() > 0) {
            this.attributes.put("Name", str);
        } else if (this.attributes.containsKey("Name")) {
            this.attributes.remove("Name");
        }
    }

    public String getRouteName() {
        return (String) this.attributes.get("RouteName");
    }

    public void setRouteName(String str) {
        if (str != null && str.length() > 0) {
            this.attributes.put("RouteName", str);
        } else if (this.attributes.containsKey("RouteName")) {
            this.attributes.remove("RouteName");
        }
    }

    public int getSequence() {
        Integer num = (Integer) this.attributes.get("Sequence");
        if (num == null) {
            return 0;
        }
        return num.intValue();
    }

    public void setSequence(int i) {
        if (i > 0) {
            this.attributes.put("Sequence", Integer.valueOf(i));
        } else if (this.attributes.containsKey("Sequence")) {
            this.attributes.remove("Sequence");
        }
    }

    public Date getTimeWindowStart() {
        Long l = (Long) this.attributes.get("TimeWindowStart");
        if (l == null) {
            return null;
        }
        return new Date(l.longValue());
    }

    public void setTimeWindowStart(Date date) {
        if (date.getTime() > 0) {
            this.attributes.put("TimeWindowStart", Long.valueOf(date.getTime()));
        } else if (this.attributes.containsKey("TimeWindowStart")) {
            this.attributes.remove("TimeWindowStart");
        }
    }

    public Date getTimeWindowEnd() {
        Long l = (Long) this.attributes.get("TimeWindowEnd");
        if (l == null) {
            return null;
        }
        return new Date(l.longValue());
    }

    public void setTimeWindowEnd(Date date) {
        if (date.getTime() > 0) {
            this.attributes.put("TimeWindowEnd", Long.valueOf(date.getTime()));
        } else if (this.attributes.containsKey("TimeWindowEnd")) {
            this.attributes.remove("TimeWindowEnd");
        }
    }

    public void setAddedCost(String str, double d) {
        if (str == null || str.isEmpty()) {
            return;
        }
        Map<String, Object> map = this.attributes;
        map.put("Attr_" + str, Double.valueOf(d));
    }

    public double getAddedCost(String str) {
        Map<String, Object> map = this.attributes;
        Double d = (Double) map.get("Attr_" + str);
        return d == null ? Utils.DOUBLE_EPSILON : d.doubleValue();
    }
}
